<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
</head>
<style>
	.warp{width: 100%;}

	/*头部信息*/
	.head-box{width: 100%;height: 260px;background:url(../../image/main3/main3_bg.png) no-repeat center #FF9502;background-size:cover ;box-sizing: border-box;position: relative;}
	.head-box .top-box{width: 100%;align-items:center;padding: 80px 15px 15px 15px;box-sizing: border-box;}
	.head-box .top-box .head-img{width: 66px;height: 66px;border-radius:50%;border: 1px solid #ffffff;overflow: hidden;flex-shrink: 0;background-color:#EEEEEE;}
	.head-box .top-box .head-img img{width: 100%;display: block;}
	.head-box .top-box .name{font-size: 16px;color: #FFFFFF;padding: 0 14px;box-sizing: border-box;font-weight: 700;}
	.head-box .top-box .qiandao{background: #ffffff;border-radius:14px;height: 24px;padding: 0 12px;color: #FF9502;line-height: 24px;font-size: 12px;flex-shrink: 0;}

	/*我的订单状态*/
	.info-box1{margin: 0 15px;background: #FFFFFF;padding:0 20px 10px 20px;box-sizing: border-box;margin-bottom:10px;border-radius: 4px;margin-top: -70px;z-index: 10;position: relative;}
	.info-box1 .title{padding: 20px 0 10px 0;box-sizing: border-box;justify-content: space-between;align-items: center;}
    .info-box1 .title .text{font-size: 16px;color: #333333;font-weight: bold;}
    .info-box1 .title .text1{color: #999999;font-size: 12px;text-align: right;}
    .info-box1 .title .goto{width: 12px;height: 12px;}
	.info-box1 .nav-box{align-items: center;justify-content: space-between;}
	.info-box1 .nav-box .nav-one{width: 70px;flex-direction: column;align-items: center;justify-content: center;padding: 10px 0;border-radius: 4px;}
	.info-box1 .nav-box .nav-one .img-box{position: relative;}
	.info-box1 .nav-box .nav-one .img-box .red{width: 14px;height: 14px;background: #F13A3B;border-radius:50%;position: absolute;top: -4px;right: -4px;color: #FFFFFF;font-size:8px;
	text-align: center;line-height: 14px;}
	.info-box1 .nav-box .nav-one .img-box img{width: 100%;height: 100%;}
	.info-box1 .nav-box .nav-one .text{padding-top: 2px;box-sizing: border-box;font-size: 12px;color: #666666;padding-top: 6px;}
    .info-box1 .nav-box .nav-one:active{background:#fafafa;}

	/*跳转类表*/
	.info-list{margin-bottom: 10px;margin: 0 15px 30px 15px;box-sizing: border-box;border-radius: 4px;padding: 20px 0 ;flex-wrap: wrap;background: #ffffff;}
	.info-list .info-one{width: 33.3%;height: 80px;flex-direction: column;align-items: center;justify-content: center;border-radius: 4px;padding-bottom: 20px;}
	.info-list .info-one img{width: 32px;height: 32px;}
	.info-list .info-one .text{box-sizing: border-box;font-size: 14px;color: #666666;line-height: 20px;height: 20px;padding-top: 10px;}
    .info-list .info-one:active{background:#fafafa;}

</style>
<body>
    <div id="vue" class="warp">

    	<!--个人中心头部信息-->
		<div class="head-box" id="">
			<div class="top-box flex">
				<div class="head-img bgpic" :style="{backgroundImage:'url('+Pdata.uinfo.avatar+')'}" tapmode onclick="open_page(this)" data-title="个人资料" data-url="main3/user_show.html"></div>
				<div class="name flex1 han_1" v-text="Pdata.uinfo.nickname" tapmode onclick="open_page(this)" data-title="个人资料" data-url="main3/user_show.html">--</div>
				<div class="qiandao" tapmode onclick="qianDao()">
                    <i v-text="Pdata.uinfo.isqiandao ? '已签到':'签到'">签到</i>
                </div>
			</div>
		</div>

		<!--我的订单-->
		<div class="info-box1">
			<div class="title flex" tapmode onclick="open_order(this)" data-sta="0" data-title="我的订单" data-url="ordert/ordert_list.html">
				<div class="text">我的订单</div>
                <div class="text1 flex1">查看所有订单</div>
				<img class="goto" src="../../image/main3/main3_goto.png"/>
			</div>
			<div class="nav-box flex">
				<div class="nav-one flex" tapmode onclick="open_order(this)" data-sta="1" data-title="我的订单" data-url="ordert/ordert_list.html">
					<div class="img-box" style="width:25px;height:24px;">
						<img src="../../image/main3/main3_nav1.png"/>
						<div class="red" v-if="Pdata.order.sta_1 > 0" v-text="Pdata.order.sta_1"></div>
					</div>
					<div class="text">待付款</div>
				</div>
				<div class="nav-one flex" tapmode onclick="open_order(this)" data-sta="2" data-title="我的订单" data-url="ordert/ordert_list.html">
					<div class="img-box" style="width:25px;height:24px;">
						<img src="../../image/main3/main3_nav3.png"/>
						<div class="red" v-if="Pdata.order.sta_2 > 0" v-text="Pdata.order.sta_2"></div>
					</div>
					<div class="text">待发货</div>
				</div>
				<div class="nav-one flex" tapmode onclick="open_order(this)" data-sta="3" data-title="我的订单" data-url="ordert/ordert_list.html">
					<div class="img-box" style="width:27px;height:24px;">
						<img src="../../image/main3/main3_nav2.png"/>
						<div class="red" v-if="Pdata.order.sta_3 > 0" v-text="Pdata.order.sta_3"></div>
					</div>
					<div class="text">待收货</div>
				</div>
				<div class="nav-one flex" tapmode onclick="open_order(this)" data-sta="4" data-title="我的订单" data-url="ordert/ordert_list.html">
					<div class="img-box" style="width:25px;height:24px;">
						<img src="../../image/main3/main3_nav4.png"/>
						<div class="red" v-if="Pdata.order.sta_4 > 0" v-text="Pdata.order.sta_4"></div>
					</div>
					<div class="text">待评价</div>
				</div>
				<div class="nav-one flex" tapmode onclick="open_page(this)" data-sta="0" data-title="退款售后" data-url="ordert/tui_ordert_list.html">
					<div class="img-box" style="width:24px;height:24px;">
						<img src="../../image/main3/main3_nav5.png"/>
						<div class="red" v-if="Pdata.order.tui > 0" v-text="Pdata.order.tui"></div>
					</div>
					<div class="text">退款/售后</div>
				</div>
			</div>
		</div>

		<!--跳转列表-->
		<div class="info-list flex">
			<div class="info-one flex" tapmode onclick="open_page(this)" data-title="收货地址" data-url="user/address/list.html">
				<img src="../../image/main3/main3_goto1.png"/>
				<div class="text">收货地址</div>
			</div>
            <div class="info-one flex" tapmode onclick="open_page(this)" data-title="我的优惠券" data-url="user/quan/list.html">
				<img src="../../image/main3/main3_goto5.png"/>
				<div class="text">我的优惠券</div>
			</div>
			<div class="info-one flex" tapmode onclick="open_yaoqing(this)" data-title="邀请得好礼" data-url="main3/yaoqing.html">
				<img src="../../image/main3/main3_goto2.png"/>
				<div class="text">邀请得好礼</div>
			</div>
            <div class="info-one flex" tapmode onclick="open_page(this)" data-title="设置" data-url="main3/set.html">
                <img src="../../image/main3/main3_goto6.png"/>
                <div class="text">设置</div>
            </div>
            <div class="info-one flex" tapmode onclick="open_page(this)" data-title="我的收藏" data-url="main3/my_shoucang.html">
				<img src="../../image/main3/main3_goto3.png"/>
				<div class="text">我的收藏</div>
			</div>
			<div class="info-one flex" tapmode onclick="open_Mypingjia(this)" data-title="我的评价" data-url="main3/my_pingjia.html">
				<img src="../../image/main3/main3_goto4.png"/>
				<div class="text">我的评价</div>
			</div>
            <div class="info-one flex" tapmode onclick="open_jifen(this)" data-title="邀请得好礼" data-url="main3/my_jifen_mingxi.html">
				<img src="../../image/main3/main3_goto7.png"/>
				<div class="text">我的积分</div>
			</div>
            <div class="info-one flex" v-if="Pdata && Pdata.uinfo && Pdata.uinfo.menus && Pdata.uinfo.menus.ruzhu == 1" tapmode onclick="open_ruzhu(this)">
				<img src="../../image/main3/main3_goto8.png"/>
				<div class="text">商家入驻</div>
			</div>
            <div class="info-one flex" v-if="Pdata && Pdata.uinfo && Pdata.uinfo.menus && Pdata.uinfo.menus.store == 1" tapmode onclick="open_store(this)" data-title="我的店铺" data-url="main3/store/store.html">
				<img src="../../image/main3/main3_goto9.png"/>
				<div class="text">我的店铺</div>
			</div>
            <div class="info-one flex" v-if="Pdata && Pdata.uinfo && Pdata.uinfo.menus && Pdata.uinfo.menus.company == 1" tapmode onclick="open_company(this)" data-title="分公司" data-url="main3/company/company.html">
				<img src="../../image/main3/main3_goto10.png"/>
				<div class="text">分公司</div>
			</div>
		</div>
    </div>
</body>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">

	define(function (require, exports, module) {

        lanYun.indexSetHeader('app-header');
        //获取用户数据
        setData = function () {
            var udata = lanYun.getUdata();
            if(!udata) return;
            lanYun.vue.Pdata.uinfo = udata;
            getuserinfo();
            getOrderNum();
        };

        //获取订单数量
        getOrderNum = function (){
            lanYun.ajaxSta = 0;
            lanYun.get('UserOrder/getStaNum' ,function (ret) {
                //console.log(JSON.stringify(ret));
                if(ret.errcode == 0){
                    lanYun.vue.Pdata.order = ret.data;
                }
            });
        }
        //获取用户信息
        getuserinfo = function (){
            lanYun.get('User/getinfo' ,function (ret) {
                //console.log(JSON.stringify(ret));
                if(ret.errcode == 0){
                    lanYun.vue.Pdata.uinfo = ret.data;
                    lanYun.updateUdata(ret.data, 0);
                    lanYun.event('mainRed');
                }
            });
        }

        lanYun.newVue('#vue',{
            Pdata:{
                uinfo:{
                    avatar:'',
                    cfg:{},
                    menus:{
                        ruzhu:0,
                        store:0,
                        company:0,
                    }
                },
                order:{},
            }
        },function(){});

        // 签到
        qianDao = function (){
            var sta = lanYun.vue.Pdata.uinfo.isqiandao;
            if(sta){
                lanYun.toast('今天已签到');
                return;
            }
            lanYun.get('user/qiandao',function (ret){
                //console.log(JSON.stringify(ret));
                if (ret.errcode == 0) {
                    lanYun.vue.Pdata.uinfo = ret.udata;
                    lanYun.updateUdata(ret.udata, 0);
                    lanYun.alert({fname:'diaLogBox1',title:'提示', button:['确定'],content: ret.msg},function(ret){});
                }else {
                    lanYun.toast(ret.msg);
                }
            },2)
        }

		//打开页面
		open_page = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'win',
	           	title:dst.title,
	            frameParam : dst
	       });
	    }

        //打开我的订单
        open_order = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'win',
	           	title:dst.title,
                menu:"<i style='color:#FF9502'>筛选</i>",
	            frameParam : dst
	       });
	    }

        // 去评价
        open_Mypingjia = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'win',
	           	title:dst.title,
                menu:"<i style='color:#FF9502'>去评价</i>",
	            frameParam : dst
	       });
	    }

        //打开邀请
        open_yaoqing = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'win_jf',
	           	title:dst.title,
                menu:"邀请规则",
	            frameParam : dst
	       });
	    }

        //打开邀请
        open_jifen = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'win_jf',
	           	title:'',
                menu:"<img id='yq_icon' src='../../image/main3/yq_guize.png'>",
	            frameParam : dst
	       });
	    }

        // 商家入驻
        open_ruzhu = function (tis) {
	        var dst = tis.dataset;
            var sta = lanYun.vue.Pdata.uinfo.store_in_sta;
            var url = '';
            var t = '';
            if( sta == 0 ){
                url = "main3/ruzhu/ruzhu.html";
                t = "商家入驻";
                btn = "审核结果";
           }else {
               url = "main3/ruzhu/shenhe.html";
               t = "入驻审核";
               btn='';
           }
           lanYun.openWin(url, {
               win:'win',
               border:'1',
               title:t,
               menu:btn,
               frameParam : {}
           });
	    }

        // 我的店铺
        open_store = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'none',
	            frameParam : dst
	       });
	    }

        // 分公司
        open_company = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin(dst.url, {
	            win:'none',
	            frameParam : dst
	       });
	    }

	});


</script>

</html>
